﻿using Demo.Domains.Entities.Sys;
using PmSoft.FormSchema.Attributes;
using System.ComponentModel.DataAnnotations;

namespace Demo.PetaPoco.Application.Dtos.User;

/// <summary>
/// 用户创建模型
/// </summary>
[FormName("userCreateModel")]
public class UserCreateModel
{
	/// <summary>
	/// 姓名或昵称 
	///</summary>
	[Display(Name = "姓名")]
	[Required(ErrorMessage = "{0}为必填项")]
	public string Name { get; set; }
	/// <summary>
	/// 用户类型 
	///</summary>
	[Display(Name = "用户类型")]
	[Required(ErrorMessage = "{0}为必选项")]
	[FromRadioGroup]
	public UserType? Type { get; set; }
	/// <summary>
	/// 电子邮箱 
	///</summary>
	[Display(Name = "电子邮箱")]
	[Required(ErrorMessage = "{0}为必填项")]
	[EmailAddress]
	public string Email { get; set; }
	/// <summary>
	/// 手机号码 
	///</summary>
	[Display(Name = "手机号码")]
	[Required(ErrorMessage = "{0}为必填项")]
	public string Mobile { get; set; }
	/// <summary>
	/// 单位ID 
	///</summary>
	[Display(Name = "单位")]
	[Required(ErrorMessage = "{0}为必选项")]
	[FormApiSelect("system/dept/select")]
	public int? DeptId { get; set; }
	/// <summary>
	/// 密码 
	///</summary>
	[Display(Name = "密码")]
	[Required(ErrorMessage = "{0}为必填项")]
	public string Password { get; set; }
}
